package net.maku.generator.service;

import jakarta.servlet.http.HttpServletResponse;
import net.maku.generator.common.page.PageResult;
import net.maku.generator.config.template.TemplateInfo;
import net.maku.generator.domain.entity.TableEntity;
import net.maku.generator.domain.query.Query;
import net.maku.generator.common.service.BaseService;
import net.maku.generator.domain.entity.ProjectEntity;
import net.maku.generator.domain.vo.PreviewVO;
import net.maku.generator.domain.vo.TreeVO;

import java.io.IOException;
import java.util.List;

/**
 * 项目名变更
 *
 * @author 阿沐 babamu@126.com
 * <a href="https://maku.net">MAKU</a>
 */
public interface ProjectService extends BaseService<ProjectEntity> {

    PageResult<ProjectEntity> page(Query query);

    void download(Long id) throws IOException;

    void downloadZip(Long id, HttpServletResponse response) throws IOException;

    List<PreviewVO> preview(Long projectId);

    List<TreeVO> treeData(Long projectId);

    TemplateInfo generatorCode(Long projectId, Long tableId, Long templateId, Integer templateGroupType);

    List<TableEntity> tableList(Long projectId, String tableName);

    void delete(List<Long> idList);

    void saveData(ProjectEntity entity);
}